package top.yangbuyi.config.redis;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer;
import org.springframework.lang.Nullable;
import org.springframework.stereotype.Component;


/**
 * @description: 杨不易网站:www.yangbuyi.top
 * @program: yangbuyiopenHis2020
 * @ClassName: CustomSessionDefaultRedisSerializer
 * @create: 2020-08-28 21:55
 * @author: yangbuyi
 * @since： JDK1.8
 * @CustomSessionDefaultRedisSerializer: 监听序列化异常$
 **/

@Component("springSessionDefaultRedisSerializer")
public class CustomSessionDefaultRedisSerializer extends JdkSerializationRedisSerializer {

	  private static final Logger LOG = LoggerFactory.getLogger(CustomSessionDefaultRedisSerializer.class);

	  @Override
	  public Object deserialize(@Nullable byte[] bytes) {
			Object deserialObj = null;
			try
			{
				  deserialObj =  super.deserialize(bytes);
			}
			catch(Exception e)
			{
				  LOG.warn("deserialize session Object error!", e);
			}
			return deserialObj;
	  }

}